package com.theta.gateway.infra.common.base;

import lombok.Data;

import java.util.Collections;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 分页查询返回结果
 * @author theta
 *
 */
@ApiModel(value="分页结果")
@Data
public class PageResult<T> {
	
	/**
	 * 当前页数
	 */
	@ApiModelProperty(value="当前页码")
	private Long current;
	/**
	 * 每页显示记录数
	 */
	@ApiModelProperty(value="每页记录数")
	private Long size;
	/**
	 * 总记录数
	 */
	@ApiModelProperty(value="总记录数")
	private Long total;
	/**
	 * 查询数据列表
	 */
	@ApiModelProperty(value="查询结果集合")
	private List<T> records = Collections.emptyList();
	
	public PageResult() {
	}
	
	public PageResult(long current,long size) {
		this.current=current;
		this.size=size;
		this.total=0L;
	}
	
	public PageResult(long current,long size,long total) {
		this(current,size);
		this.total=total;
	}

}
